// import { useStore } from '@/store'
import LocalCache from '@/utils/cache'


export function usePermission(pageName: string, hanldeName: string) {
  const privilege = LocalCache.getCache('privilege')
  if (hanldeName==='query'){
    return true
  }

  if (pageName==='users' && hanldeName==='create'){
    return true
  }
  if (pageName==='users' && hanldeName==='delete'){
    return false
  }


  if (privilege === 'manager') {
    return true
  } else if (privilege === 'maintainer') {
    if (pageName === 'user') {
      return false
    }else{
      return true
    }
  } else {
    return false
  }
}
